<!DOCTYPE html>
<html lang="en-gb" dir="ltr">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Sticky - UIkit tests</title>

        <link rel="stylesheet" href="../../dist/css/uikit.css" media="screen" charset="utf-8">

        <script src="../_test.js"></script>
        <script src="../../src/js/components/sticky.js"></script>

    </head>

    <body>

        <div class="uk-container uk-container-center" style="height: 3500px;">

            <h1>Sticky</h1>

            <div class="uk-width-1-4">
                <p>Margin before sticky</p>
                <div class="uk-margin" data-uk-sticky>Stick at the top</div>
                <p>Margin after sticky</p>
            </div>

            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>


            <div class="uk-margin uk-grid">
                <div class="uk-width-1-3">
                    <div class="uk-panel uk-panel-box" data-uk-sticky="{top:100}">Stick 100px below the top</div>
                </div>
                <div class="uk-width-1-3">
                    <div class="uk-panel uk-panel-box" data-uk-sticky="{top:'-70vh'}">Stick after 70vh</div>
                </div>
                <div class="uk-width-1-3">
                    <div class="uk-panel uk-panel-box" data-uk-sticky="{top:'#stick'}">Only stick on grid below</div>
                </div>
            </div>

            <div class="uk-margin uk-grid" id="stick">
                <div class="uk-width-1-2">
                    <div class="uk-panel uk-panel-box uk-panel-box-primary" style="height:300px;">
                        <div class="uk-panel uk-panel-box" data-uk-sticky="{boundary:true}">Sticky bound to parent container</div>
                    </div>
                </div>
                <div class="uk-width-1-2">
                    <div class="uk-panel uk-panel-box uk-panel-box-primary" style="height:300px;">
                        <div class="uk-panel uk-panel-box" data-uk-sticky="{boundary:'#test'}">Sticky bound to next paragraph</div>
                    </div>
                </div>
            </div>

            <p id="test">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

            <div class="uk-grid">
                <div class="uk-width-1-2">
                    <div class="uk-panel uk-panel-box uk-panel-box-primary" data-uk-sticky="{top:-200, animation: 'uk-animation-slide-top', media: 640}">Stick at the top but only after 200px scrolling and min. device width of 640px</div>
                </div>

                <div class="uk-width-1-2">
                    <div class="uk-panel uk-panel-box uk-panel-box-primary" data-uk-sticky="{showup: true, animation: 'uk-animation-slide-top'}">Show sticky only on scoll up</div>
                </div>
            </div>

        </div>

    </body>
</html>
